package com.mark.web.sys.entity.vo;

import com.mark.web.sys.entity.po.Dict;
import lombok.Data;

/**
 * @Description: 字典vo类
 * @Author: Mark
 * @CreateDate: 2019/6/8 18:17
 * @Version: 2.0
 * @Copyright : 豆浆油条个人非正式工作室
 */
@Data
public class DictVo {

    /**
     * 主键id
     */
    private Integer id;

    /**
     * 父级id，无父级字典赋值为0
     */
    private Integer parentId;

    /**
     * 字典名称
     */
    private String name;

    /**
     * 字典值
     */
    private Short value;

    /**
     * 权重：排序用
     */
    private Short priority;

    /**
     * 是否可以改变
     */
    private Byte isCanChange;

    /**
     * 描述
     */
    private String description;

    /**
     * 通过构造函数构造字典vo实例
     * @param dict 字典实例
     */
    public DictVo(Dict dict){
        this.id = dict.getId();
        this.parentId = dict.getParentId();
        this.name = dict.getName();
        this.value = dict.getValue();
        this.priority = dict.getPriority();
        this.isCanChange = dict.getIsCanChange();
    }
}
